//
// Assets.cpp
//
/*
	Assets belong to scenes. They're needed to know how to render a model inside the scene.
*/

#include "Common.h"

Model* Assets::GetModel(const std::string &databaseDirectory, const std::string &modelId)
{
    if(_models.find(modelId) != _models.end())
    {
		// ++TODO: Ideally, _models should be in SceneTester.h
        return _models[modelId];
    }

    Model *result = new Model(databaseDirectory + "models/", modelId, *this);
    _models[modelId] = result;
    return result;
}

GLuint Assets::GetTexture(const std::string &filename)
{
    if(_textures.find(filename) != _textures.end())
    {
        return _textures[filename];
    }
    GLuint result = Utility::MakeOpenGLBitmap(filename);
    _textures[filename] = result;
    return result;
}
